package plus.modular.common.lang;

import java.util.ArrayList;
import java.util.LinkedHashMap;

public class LMap<K, V> extends LinkedHashMap<K, V> {

    /**
     *
     */
    private static final long serialVersionUID = 7998631661704483191L;

    public LMap<K,V> set(K key, V value){
        this.put(key, value);
        return this;
    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public LMap<K,V> setListValue(K list_key, V value){
        if(this.get(list_key) == null){
            this.put(list_key, (V) new ArrayList<Object>());
        }
        ((ArrayList)this.get(list_key)).add(value);
        return this;
    }
}
